package logic

import (
	"context"
	"shop_srv/models"

	"shop_srv/internal/svc"
	"shop_srv/shop"

	"github.com/zeromicro/go-zero/core/logx"
)

type CartAddLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewCartAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CartAddLogic {
	return &CartAddLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *CartAddLogic) CartAdd(in *shop.CartAddRequest) (*shop.CartAddResponse, error) {
	// todo: add your logic here and delete this line
	var err error
	var u models.User
	var g models.Goods

	if err = u.GetUserByID(in.UserId); err != nil {

	}
	if u.ID == 0 {

	}
	if err = g.GetGoodsById(in.GoodsId); err != nil {

	}

	return &shop.CartAddResponse{}, nil
}
